<?php require_once('includes/config.php'); ?>
<?php require_once('includes/commonfunctions.php'); ?>
<?php

if($_POST)
{
	/*
	$fromname 	= $_POST['contact_name'];
	$fromaddr 	= $_POST['contact_email'];
	$toaddr 	= 'jignesh.panchi@gmail.com';
	$ccaddr 	= '';
	$subject 	= 'Contact Us';
	$bodymsg 	= $_POST['contact_message'];
	$attachfilepath = NULL;
	$attachfilename = NULL;
	
	$sendemail = sendauthemail($fromname,$fromaddr,$toaddr,$ccaddr,$subject,$bodymsg,$attachfilepath,$attachfilename,1);
	echo $sendemail;exit;
	*/
	
	require_once($rootpath.'includes/libraries/PHPMailer/class.phpmailer.php');
	//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
	
	$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
	
	$mail->IsSMTP(); // telling the class to use SMTP
	
	try {
	  $mail->Host       = "smtpout.asia.secureserver.net"; // SMTP server
	  $mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
	  $mail->SMTPAuth   = true;                  // enable SMTP authentication
	  //$mail->SMTPSecure = 'ssl';
	  $mail->Host       = "smtpout.asia.secureserver.net"; // sets the SMTP server
	  $mail->Port       = 465;                    // set the SMTP port for the GMAIL server
	  $mail->Username   = "info@indianmobileprice.com"; // SMTP account username
	  $mail->Password   = "123456";        // SMTP account password
	  $mail->AddReplyTo('info@indianmobileprice.com', 'First Last');
	  $mail->AddAddress('info@indianmobileprice.com', 'John Doe');
	  $mail->SetFrom('info@indianmobileprice.com', 'First Last');
	  $mail->AddReplyTo('info@indianmobileprice.com', 'First Last');
	  $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
	  $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
	  $mail->MsgHTML('test');
	  //$mail->AddAttachment('images/phpmailer.gif');      // attachment
	  //$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
	  
	  //echo '<pre>';var_dump($mail);exit;
	  $mail->Send();
	  echo "Message Sent OK</p>\n";
	} catch (phpmailerException $e) {
	  echo $e->errorMessage(); //Pretty error messages from PHPMailer
	} catch (Exception $e) {
	  echo $e->getMessage(); //Boring error messages from anything else!
	}
}

//-------------------------------------------------------------------------------------------------------//
$metaTitle = 'Contact Us - Indian Mobile Price';
$metaDescription = 'find best price and specifications for mobile phones in india';
$metaKeywords = 'mobile phone, mobile phone price, indian mobile phones, mobile phone pricing, cellphones, cheap mobile phones, low rate';
?>
<?php include('includes/header.php')?>
<script type="text/javascript" src="js/boxOver.js"></script>
<script type="text/javascript" src="js/validatefunctions.js"></script>
<script type="text/javascript" src="js/contact_us.js"></script>
</head>
<body>
<div id="main_container">
	<?php include('includes/toppart.php')?>       
      
	<?php include('includes/leftpart.php')?>
	
   <div class="center_content">
   	<div class="center_title_bar">Contact Us</div>
    
    	<div class="prod_box_big">
        	<div class="top_prod_box_big"></div>
            <div class="center_prod_box_big">             
                <form name="contactForm" id="contactForm" method="post" action="<?=$_SERVER['PHP_SELF']?>" onSubmit="javascript:return Validate();">       
              	<div class="contact_form">
                    <div class="form_row">
                    <label class="contact"><strong>Name:</strong></label>
                    <input type="text" class="contact_input" id="contact_name" name="contact_name" value="" />
                    </div>  

                    <div class="form_row">
                    <label class="contact"><strong>Email:</strong></label>
                    <input type="text" class="contact_input" id="contact_email" name="contact_email" value="" />
                    </div>


                    <div class="form_row">
                    <label class="contact"><strong>Phone:</strong></label>
                    <input type="text" class="contact_input" id="contact_phone" name="contact_phone" value="" />
                    </div>
                    
                    <div class="form_row">
                    <label class="contact"><strong>Company:</strong></label>
                    <input type="text" class="contact_input" id="contact_company" name="contact_company"  value="" />
                    </div>


                    <div class="form_row">
                    <label class="contact"><strong>Message:</strong></label>
                    <textarea class="contact_textarea" id="contact_message" name="contact_message"></textarea>
                    </div>

                    
                    <div class="form_row">
                    <!--<a href="#" class="contact">send</a>-->
		    			<input type="submit" value="Send" />
                    </div>      
                </div> 
				</form>                
                                     
            </div>
            <div class="bottom_prod_box_big"></div>                                
        </div>
       
    
   
   </div><!-- end of center content -->
   
   <?php include('includes/rightpart.php')?> 
   
            
   </div><!-- end of main content -->
   
   
   
   <?php include('includes/bottompart.php')?>                


</div>
<!-- end of main_container -->
</body>
</html>